home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12390 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  48 lines

  1. Path: eccdb1.pms.ford.com!usenet
  2. From: Randy Hanna <hanna@vd0001.pto.ford.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Directly Accessing Memory in Windows 3.1
  5. Date: Tue, 19 Mar 1996 15:09:17 -0800
  6. Organization: ECC at Ford Motor Company, Dearborn Michigan
  7. Message-ID: <314F3E9D.4086@vd0001.pto.ford.com>
  8. NNTP-Posting-Host: vd2012.pto.ford.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win16; I)
  13.  
  14. I have a special hardware card for my PC that provides RF
  15. communication between an antenna and an RF tag. You communicate
  16. with this card putting instructions into its registers. The
  17. company that sells the card call it dual port memory.
  18.  
  19. Essentially there are jumpers on the card that allow you to
  20. set the physical memory location the card will look at to
  21. get its instructions and store its data. For example,
  22. I set my jumpers to be xEA000 or 958464 in decimal.
  23.  
  24. My question is, how can access memory directly in Windows 3.1 (using
  25. either Borland C++ or Visual C++).
  26.  
  27. I have successfully the following to access address xD0000:
  28.  
  29. Note: I don't know why or how this works, but it does!!!!
  30. ___________________________________________________________
  31.  
  32. extern "C" WORD _D000h; //Note: I don't know where this is defined???
  33.  
  34. LPSTR lpHS900Memory;
  35.  
  36. lpHS900Memory = (LPSTR)MAKELONG(0,&_D000h);
  37.  
  38. ___________________________________________________________
  39.  
  40. The above gives me a direct pointer to physical memory location
  41. xD0000. Again, I don't how or why this works.
  42.  
  43. So my question is there a general method (not using that
  44. extern "C" WORD _D000h stuff I don't understand)to obtain
  45. a pointer to any given physical memory address?
  46.  
  47. Thanks in advance for any help.
  48.